import numpy as np
from scipy import ndimage

vector = np.array([
    [1.0, 1.0, 1.0, 1.0, 1.0],
    [2.0, 2.0, 2.0, 2.0, 2.0],
    [4.0, 4.0, 4.0, 4.0, 4.0],
    [5.0, 5.0, 5.0, 5.0, 5.0]])
print(vector)
filtered = ndimage.uniform_filter(vector, 3, mode='reflect')
print(filtered)

